package com.example;

/**
 * Created by dllo on 16/1/20.
 */
public class RedheadDuck extends Duck implements FlyBehavior, QuackBehavior {
    public RedheadDuck() {
        setFlyBehavior(this);
        setQuackBehavior(this);
    }

    @Override
    public void display() {
        System.out.print("红头鸭");
    }

    @Override
    public void swim() {
        System.out.print("红头鸭会游泳");
    }

    @Override
    public void fly() {
        System.out.print("红头鸭不会飞");
    }

    @Override
    public void quack() {
        System.out.print("红头鸭呱呱叫");
    }
}
